package com.cos.shiro.linked;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.LinkedHashMap;

/**
 * @author: COS
 * @time: 2021/11/23 10:43
 * @description: 自定义工厂
 */
@Component("xxx")
public class FilterChainDefinitionMapsBuilder {

    public LinkedHashMap<String, String> builderFilterChainDefinitionMap(){
        LinkedHashMap<String, String> map = new LinkedHashMap<>();
        map.put("/login.jsp","anon");
        map.put("/user/login", "anon");
        map.put("/user/logout", "logout");
        map.put("/user.jsp", "roles[ROLE_USER]");
        map.put("/admin.jsp", "roles[ROLE_ADMIN]");
        map.put("/**", "authc");
        return map;
    }
}
